home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / dev / cross / dass05sc.lha / readme.doc < prev   
Text File  |  1995-08-28  |  11KB  |  304 lines

  1. dass05sc - version 0.9   (27.08.1995)
  2.  
  3. (c)1995 by Klaus Hegemann
  4.  
  5.  
  6.  
  7. INTRODUCTION:
  8.  
  9.    dass05sc allows you to monitor/disassemble binary data of at least
  10. the Motorola MC68HC05SC21 smart card microcontroller.
  11. Command line operation is supported as well as a 'batch' like control-
  12. file operation (recommended).
  13.  
  14.    FOR THE QUICKSTARTERS: have a look at the EXAMPLES at the end of
  15. this text.
  16.  
  17.    There are slight differences between the Amiga and the PC version of
  18. this program concerning the command line syntax. Have a look at
  19. 'DIFFERENCES'
  20.  
  21.  
  22. BACKGROUND:
  23.  
  24.    Well, it was hard enough to find a disassembler for the 68hc05 type
  25.    microprocessor until I was told that the 68hc05_SC_ makes use of a
  26.    modified coding of the instruction byte. :-|  And, as far as I searched
  27.    some of the 'motorola stuff'-filled ftp servers and the motorola bbs
  28.    itself in Germany there seemed to be no disassembler for this type of uP
  29.    publicly available. Thanks to Marc Wirth who responded to my complains
  30.    ;-) and supplied me with information about the smart card version of the
  31.    hc05. To cut it short: There was no disassembler, so I had to write one.
  32.    As a result, I added some more features and decided to make it public
  33.    available.
  34.  
  35.  
  36. USAGE:
  37.  
  38.    AmigaOS Template: BINFILE/A,CONTROLFILE=CF/K,START=S/K,END=E/K,
  39.    OFFSET=O/K,PLUSHEXDUMP=DM/S,HEXONLY=M/S
  40.  
  41.    general Information on template usage:
  42.    '/A': required argument; '/K': keyword, must be placed in front of the
  43.    argument; '/S': switch option; 'WORD1=W1':  WORD1 and W1 do have the
  44.    same meaning. Use as keyword or switch.
  45.  
  46.    BINFILE:         Filename of the binary to be disassembled.
  47.    CONTROLFILE=CF:  Option: 'batch'-like operation mode (see below). No
  48.                     further command line args needed, except the BINFILEname.
  49.    command line operation:
  50.    START=S:         Specify the start location within the binary for
  51.                     disassembly and hexdump
  52.    END=E:           end location for disassembly/hex dump. If not specified
  53.                     a default of 20 output lines is set.
  54.    OFFSET=O:        If your binary proviedes relocated code, you may specify
  55.                     a signed value to cause the output to appear at a correct
  56.                     location. E.g. your binary contains the smart card memory
  57.                     image $0000 - $1fff with activated 1st codepage and
  58.                     from $2000 - $3fff with activated second codepage:
  59.                     simply specify an offset of -$2000 when inspecting code
  60.                     of the second code page.
  61.    PLUSHEXDUMP=DM:  An additional hex dump is placed on the right side near
  62.                     the disassebled output. Useful e.g. to distinguish
  63.                     between wild code and ascii text...
  64.    HEXONLY=M:       Memory hex-dump option.
  65.  
  66.  
  67. EXAMPLES: CLI
  68.  
  69.    >dass05sc t:bin start=$1000
  70.    >dass05sc t:bin start $1000
  71.    >dass05sc t:bin s=$1000
  72.    >dass05sc t:bin s=4096
  73.    they all produce the same output:
  74.    ====================<begin>====================================
  75.    *** dass05sc V0.9 disassembler for 68hc05sc21 type binaries ***
  76.    (w)1995 by Klaus Hegemann. Freely distributable.
  77.    
  78.    read 16384 data bytes from file 'bin'
  79.    
  80.    1000: 00         rti                
  81.    
  82.    1001: 00         rti                
  83.    
  84.    1002: 00         rti                
  85.    
  86.    1003: 00         rti                
  87.    
  88.    1004: 00         rti                
  89.    
  90.    1005: 00         rti                
  91.    
  92.    1006: 00         rti                
  93.    
  94.    1007: 00         rti                
  95.    
  96.    1008: 00         rti                
  97.    
  98.    1009: 00         rti                
  99.    
  100.    100a: 00         rti                
  101.    
  102.    100b: 00         rti
  103.    ====================<end>======================================
  104.  
  105.    >dass05sc t:bin hexonly start=$1000 end=$1020
  106.    >dass05sc t:bin m start=$1000 end=$1020
  107.    >dass05sc t:bin m start=4096 end=4128
  108.    each one results in:
  109.    ====================<begin>====================================
  110.    [...]
  111.    read 16384 data bytes from file 't:bin'
  112.    
  113.    1000: 00 00 00 00 00 00 00 00   '........'
  114.    1008: 00 00 00 00 00 00 00 00   '........'
  115.    1010: 00 00 00 00 00 00 00 00   '........'
  116.    1018: 00 00 00 00 00 00 00 00   '........'
  117.    1020: 00
  118.    ====================<end>======================================
  119.  
  120.    >dass05sc t:bin plushexdump start=$07e9 end=$07fd offset=-$07e9
  121.    >dass05sc t:bin dm s=$07e9 e=$07fd o=-$07e9
  122.    each one results in:
  123.    ====================<begin>====================================
  124.    [...]
  125.    read 16384 data bytes from file 't:bin'
  126.  
  127.    0000: 2f         txa                0000:    2f 4d 1d 3d 3f 87 37   ' /M.=?.7'
  128.    0001: 4d 1d 3d   jsr   $1d3d        
  129.    0004: 3f 87      stx   $87          
  130.    0006: 37 95      sta   $95          0007: 95 3b 96 93 3a 3b 93 97   '.;..:;..'
  131.    0008: 3b 96      ldx   $96          
  132.    000a: 93 3a      bne   $0046        
  133.    000c: 3b 93      ldx   $93          
  134.    000e: 97 04      beq   $0014        000f: 04 16 06 96 32 3b         '....2;  '
  135.    0010: 16 06      cpx   #$06         
  136.    0012: 96 32      bls   $0046        
  137.    0014: 3b a6      ldx   $a6
  138.    ====================<end>======================================
  139.  
  140.  
  141.  
  142. EXAMPLES: CONTROLFILE:
  143.  
  144.    In controlfile operation there are some differences/additions:
  145.    The line:
  146.    e "***"
  147.    simply outputs the chars between the two (")s
  148.    d <start> <end> <offset>
  149.    will disassemble from <start> to <end> with an offset of <offset>
  150.    No keywords are allowed. <start> and <end> must be specified,
  151.    <offset> may not. You may use hexadecimal Numbers, introduced
  152.    by a '$'. If not, the line parser expects a decimal value.
  153.    d- <start> <end> <offset>
  154.    Suppresses additional blank lines after JMPs, BRAs, STOPs, WAITs,
  155.    etc.
  156.    m <start> <end> <offset>
  157.    Memory hex-dump
  158.    dm- <start> <end> <offset>
  159.    Disassembler dump with additional hex dump, no extra blank lines
  160.    after JMPs, BRAs, etc...
  161.  
  162.    controlfile 't:control' consists of (without the '>'):
  163.    ====================<begin>====================================
  164.    e "***************************************"
  165.    e "*  lots of zero's                     *"
  166.    e "***************************************"
  167.    m $052a $0543 -$0100
  168.    e "***************************************"
  169.    e "*  some machine code                  *"
  170.    e "***************************************"
  171.    d $0573 $057c
  172.    e "***************************************"
  173.    e "* and now with additional hex dump    *"
  174.    e "***************************************"
  175.    dm $0573 $057c -$73
  176.    e "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
  177.    e "% in jump tables there is no need for %"
  178.    e "% empty lines after JMPs, BRAs,...    %"
  179.    e "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
  180.    d- $0573 $057c -$73
  181.    e "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
  182.    dm- $0573 $057c -$73
  183.    ====================<end>======================================
  184.    will be used by dass05sc if you supply the 'CONTROLFILE' keaword:
  185.    
  186.    >dass05sc t:bin controlfile=t:control
  187.    >dass05sc t:bin cf=t:control
  188.  
  189.    that will cause the following output:   
  190.    ====================<begin>====================================
  191.    *** dass05sc V0.9 disassembler for 68hc05sc21 type binaries ***
  192.    (w)1995 by Klaus Hegemann. Freely distributable.
  193.    
  194.    read 16384 data bytes from file 't:bin'
  195.    
  196.    ***************************************
  197.    *  lots of zero's                     *
  198.    ***************************************
  199.    042a:       00 00 00 00 00 00   '  ......'
  200.    0430: 00 00 00 00 00 00 00 00   '........'
  201.    0438: 00 00 00 00 00 00 00 00   '........'
  202.    0440: 00 00 00 00               '....    '
  203.    ***************************************
  204.    *  some machine code                  *
  205.    ***************************************
  206.    0573: 49 13 bf   jmp   $13bf        
  207.    
  208.    0576: 49 14 93   jmp   $1493        
  209.    
  210.    0579: 49 14 cf   jmp   $14cf        
  211.    
  212.    057c: 49 14 ab   jmp   $14ab        
  213.    
  214.    ***************************************
  215.    * and now with additional hex dump    *
  216.    ***************************************
  217.    0500: 49 13 bf   jmp   $13bf        0500:          49 13 bf 49 14   '   I..I.'
  218.    
  219.    0503: 49 14 93   jmp   $1493        0505: 93 49 14 cf 49            '.I..I   '
  220.    
  221.    0506: 49 14 cf   jmp   $14cf        
  222.    
  223.    0509: 49 14 ab   jmp   $14ab        
  224.    
  225.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  226.    % in jump tables there is no need for %
  227.    % empty lines after jmps, bras,...    %
  228.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  229.    0500: 49 13 bf   jmp   $13bf        
  230.    0503: 49 14 93   jmp   $1493        
  231.    0506: 49 14 cf   jmp   $14cf        
  232.    0509: 49 14 ab   jmp   $14ab        
  233.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  234.    0500: 49 13 bf   jmp   $13bf        0500:          49 13 bf 49 14   '   I..I.'
  235.    0503: 49 14 93   jmp   $1493        0505: 93 49 14 cf 49            '.I..I   '
  236.    0506: 49 14 cf   jmp   $14cf        
  237.    0509: 49 14 ab   jmp   $14ab        
  238.    
  239.    ====================<end>======================================
  240.    
  241.  
  242.    In controlfile operation you are supposed to prefer a file
  243.    in wich the information should be dumped.
  244.    To achieve that, simply use the output redirect option that
  245.    comes with your DOS: (Amiga and PC as well)
  246.  
  247.    >dass05sc t:bin controlfile=t:control >disassembled.txt
  248.    >dass05sc t:bin cf=t:control >disassembled.txt
  249.  
  250.  
  251. DIFFERENCES: (usage Amiga <-> PC)
  252.  
  253.      Only the command line hanling is concerned. On the Amiga, I prefered
  254.    using the command line parser that comes with AmigaOS, rather than
  255.    the ANSI parser supplied with the C-Compiler.
  256.      
  257.    On the PC the command line usage is almost the same:
  258.    * you  must supply the keywords in its short form.
  259.          (e.g. 'CF' insted of 'CONTROLFILE')
  260.    * you must supply a '=' after the keywords.
  261.    
  262.    Maximum binary size : Amiga=64k PC=32k
  263.   
  264.  
  265. BUGS:
  266.  
  267.      No error messages yet, it simply quits if something's wrong.
  268.    I suggest that you may provoke a crash, if the cli/controlfile syntax 
  269.    becomes too obscure...
  270.    All in all and as you can see it at the version number, this proggi
  271.    is still a kind of 'beta', quick & dirty... but right now there are
  272.    other things (i.e. the next exams) that I ought to worry about.
  273.  
  274.  
  275. DISCLAIMER/DISTRIBUTION:
  276.  
  277.      Both programs, the Amiga and the PC version of this program are
  278.    freely distributible, but they are not public domain.
  279.    The contents of this distribution are copyrigthed matrial, and may not
  280.    be altered without express permission of the author.
  281.      dass05sc may be distributed by any means, electronic or physical,
  282.    provided no charge, other than for small handling fees such as disk
  283.    medium charges, is made.  It may be distributed on commercial electronic
  284.    networking services, provided that no fee is made explicitly for it's
  285.    acquirement, though a general blanket downloading charge is permissable.
  286.    Inclusion on the Aminet and Fred Fish CDs is welcomed due to their long
  287.    standing support of the Amiga.
  288.      I am in no way responsible in any damage that may result in using this
  289.    program or in using of its output. There is no warranty of any kind.
  290.  
  291.    archive contents:
  292.    
  293.    AmiDass05sc      19552 bytes   executable for Amiga
  294.    PcDass05sc.exe   52754 bytes   executable for PC
  295.    readme.doc       11460 bytes   this text
  296.  
  297.  
  298. AUTHOR:
  299.  
  300.    Klaus Hegemann     klausi@higgens.tng.oche.de
  301.    Hirschgraben 13    hegeman@reze-1.rz.rwth-aachen.de
  302.    52062 Aachen
  303.    -Germany-
  304.